Subject: Re: Compiler and disc problems
From: "Andrew Church" <[email-masked]>
To: "amos-list" <[email-masked]>
Date: 6 Sep 93 18:13:00 EST

>>  If he only saves the variables he absolutely needs to, the
>> save time would be cut down by a lot.  Even if he hasn't optimized his
>> variables (bit-packing and such), he shouldn't need more than 1k or so.
>
>        Optimizing variables, bit-packing? I haven't heard of these
>techniques, so could someone please tell me more?

  What I meant is, to take an example from my role-playing game:  I have
128 boolean flags that indicate progress or the occurrence of certain
events.  Instead of creating an integer array of 128 values, one for each
flag, I put them all into a 4-integer array, one bit per flag, thereby saving
myself 496 bytes.  Or, if you have a lot of variables that are all in the
range 0 to 255, use a memory bank or a string to store them instead of a bunch
of integer variables or an integer array.  In other words,

ARRAY(55)=120

becomes

Poke ARRAYSTART+55,120

or

Poke Varptr(ARRAY$)+55,120

where ARRAYSTART is the start of a bank that has one byte per variable, and
ARRAY$ is initialized as "ARRAY$=Space$(NUM_VARS)".

>        Also, thanks for all the replies to my previous message about
>compiler end disc problems. They helped a lot!

  You're quite welcome.

  --Andy Church